<html>
<head></head>

<body>
<div id="dbDiv">
<?php
//following Doza's MySQL connection example I will highlight what this page does.
$conn = new mysqli('localhost','root','','SEVENBITS','3306');
if(mysqli_connect_errno()){
echo "connection failed";
}else {
echo "connection successful <br> Displaying list of Emplyees";
}
$sql = "SELECT * FROM employees";
$result = $conn->query($sql);
if($result->num_rows>0){
while($row = $result->fetch_assoc()){
//in this area the code is displlaying fields from the database pulling directly from the view.
echo "<br> id: " . $row['EmpID']. "- name: ". $row['EmpFname'];
//on this line however it is creating a link in which to connect to another page but with 
//variables attached to it based on the entry of the row. in this case it is collecting the employee ID.
echo '<a href = "template.php?ID=' . urlencode($row['EmpID']),'">Link to Profile</a>';
}
}
else{
echo "0 results found ";
}

$conn->close();
echo "<br> Connection closed<br>No further Employees.";





?>
</div>
</body>
</html>
